#ifndef OPENCVVIEW_H
#define OPENCVVIEW_H

#include <QWidget>
#include <QImage>
#include <QPaintEvent>
#include <QPainter>
#include "opencv2/opencv.hpp"
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace std;
using namespace cv;

class opencvView : public QWidget
{
    Q_OBJECT

public:
    explicit opencvView(QWidget *parent = 0);
    ~opencvView();
    QImage Mat2QImage(Mat &cvImg);
    Mat QImage2Mat(QImage &qImg);
    void OpencvPaint(Mat &cvImg);

protected:
    void paintEvent(QPaintEvent *e);

private:
    QImage *image;
};

#endif // OPENCVVIEW_H
